var getQueryJsonParams = function(token, empCode, startDate, endDate, actionContent, noteTitle, pageStart, pageSize) {
    // var passUrl = "beginDate=" + encodeURIComponent(startDate) + "&endDate=" + encodeURIComponent(endDate) + "&actionContent=" + encodeURIComponent(actionContent) + "&noteTitle=" + encodeURIComponent(noteTitle) + "&pageStart=" + (pageStart * pageSize) + "&pageLimit=" + pageSize;   
    var passUrl = "beginDate=" + encodeURIComponent(startDate) + "&endDate=" + encodeURIComponent(endDate) + "&actionContent=" + actionContent + "&noteTitle=" + noteTitle + "&pageStart=" + (pageStart * pageSize) + "&pageLimit=" + pageSize;
    var params = {
        "token": token,
        "staffNo": empCode,
        "passUrl": passUrl
    };
    return params;
};

var getActionKind = function(kind) {
    var actionKindArray = {
        "1": "集团业务推广",
        "2": "数据业务推广",
        "3": "服务关怀",
        "4": "预警处理",
        "5": "商机信息管理",
        "6": "竞争信息管理",
        "7": "基础信息更新",
        "8": "多渠道协同",
        "10": "临时任务",
        "11": "公司内部任务",
        "12": "个人VIP服务"
    };
    return actionKindArray[kind];
}

var getActionType = function(type) {
    var actionTypeArray = {
        "1": "上门",
        "2": "短信",
        "3": "电话",
        "4": "信函",
        "5": "邮件"
    };
    return actionTypeArray[type];
}

var getDetailJsonParams = function(token, empCode, workNoteId) {
    var passUrl = "workNoteId=" + workNoteId;
    var params = {
        "token": token,
        "staffNo": empCode,
        "passUrl": passUrl
    };
    return params;
};

var getAddTaskLogJsonParams = function(token, empCode, actionType, actionKind,actionContent,noteTitle,beginDate,endDate,grpId,grpName,chiefmgrflag,guanHuaiTypeId,contactors){
    var createDate = encodeURIComponent(new Date().format("yyyy-MM-dd hh:mm:ss"));    
    var passUrl = "actionType="+actionType+"&actionKind="+actionKind+"&actionContent="+actionContent+"&noteTitle="+noteTitle+"&beginDate="+beginDate+"&endDate="+endDate;
    passUrl += "&grpId="+grpId+"&grpName="+grpName+"&execPercent=&chiefmgrflag="+chiefmgrflag+"&guanHuaiTypeId="+guanHuaiTypeId+"&tempSaveFlag=0&contactors="+contactors;
    passUrl += "&relateContactorId=&relateContactorName=&createDate="+createDate+"&custName=&custMngerName=&noteMode=";
    var params = {
        "token": token,
        "staffNo": empCode,
        "passUrl": passUrl
    };
    return params;

}

var getCustMemberJsonParams = function(token, empCode, customer_id,pageStart,pageSize){
    var passUrl = "customer_id="+customer_id+"&cust_para_type=0&cust_para_content=&pageStart="+ (pageStart * pageSize) + "&pageLimit="+pageSize;
    var params = {
        "token": token,
        "staffNo": empCode,
        "passUrl": passUrl
    };
    return params;
}

var getGuanhuaiType = function(guanhuaiTypeId) {
    var guanhuaiTypeArray = {
        "0": "无服务关怀",
        "1": "日常服务",
        "2": "网络监测",
        "3": "挂牌驻点",
        "4": "欠费提醒",
        "5": "生日和节日问候",
        "6": "联谊活动"
    };
    return checkNil(guanhuaiTypeArray[guanhuaiTypeId]);
}

//检查 nil
var checkNil = function(str) {
    var returnStr = str;
    if (!str || str["@nil"]) {
        returnStr = "无";
    }
    return returnStr;
}

var getStateType = function(state) {
    var stateArray = {
        "1": "待处理",
        "2": "处理中",
        "3": "已派发",
        "4": "已完成",
        "5": "抄送",
        "6": "已存档",
        "7": "报上级审批",
        "8": "已提交",
        "9": "待归档"
    };
    return checkNil(stateArray[state]);
}